import request from '@/utils/request'

/**
 * 获取月卡列表信息
 * @param {*} params
 * @returns
 */
export const getCardListApi = (params) => request({
  url: '/parking/card/list', params
})

/**
 * 创建月卡
 * @param {*} data
 * @returns
 */
export const createCardApi = (data) => request({
  url: '/parking/card',
  method: 'post',
  data
})

/**
 * 删除
 * @param {*} ids
 * @returns
 */
export const delCardsApi = (id) => request({
  url: `/parking/card/${id}`,
  method: 'delete'
})

/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export function delAllCardApi(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}

/**
 * 查看详情
 * @param {*} id
 * @returns
 */
export const detailCardApi = (id) => request({
  url: `/parking/card/${id}`
})

/**
 * 编辑
 * @param {*} id
 * @returns
 */
export const editCardApi = (data) => request({
  url: '/parking/card/edit',
  method: 'put',
  data
})
